Programming Research Group A PRETTIER COMPILER-COMPILER: GENERATING HIGHER ORDER PARSERS IN C
نویسندگان
چکیده
Top-down (LL) parsers are easy to express in functional programming languages, but the elegant functional programming model can also serve as an exact prototype for a `real' implementation of the technology in ansi C. The result is a compiler-compiler that takes unlimited lookahead and backtracking, the extended BNF notation, and parameterized grammars with (higher order) metaparameters to the world of C programming. The generated code is standard ansi C and is `plug compatible' with lex-generated lexical analyzers prepared for the unix yacc compiler-compiler. In contrast to yacc, however, the generated code is modular and thus allows parts of scripts to be compiled separately and linked in incrementally, but it remains e cient, as is demonstrated by the example occam parser treated in depth here.
منابع مشابه
A PREttier Compiler-Compiler: Generating Higher-order Parsers in C
Top-down (LL) context-sensitive parsers with integrated synthesis and use of attributes are easy to express in functional programming languages, but the elegant functional programming model can also serve as an exact prototype for a more efficient implementation of the technology in ANSI C. The result is a compiler-compiler that takes unlimited lookahead and backtracking, the extended BNF notat...
متن کاملOASIS: An Optimizing Action-Based Compiler Generator
Action Semantics is a new and interesting foundation for semantics based compiler generation. In this paper we present several analyses of actions, and apply them in a compiler generator capable of generating efficient, optimizing compilers for procedural and functional languages with higher order recursive functions.The automatically generated compilers produce code that is comparable with cod...
متن کاملPractical Packrat Parsing
A considerable number of research projects are exploring how to extend object-oriented programming languages such as Java with, for example, support for generics, multiple dispatch, or pattern matching. To keep up with these changes, language implementors need appropriate tools. In this context, easily extensible parser generators are especially important because parsing program sources is a ne...
متن کاملSome Topics in Parser Generation
An algorithm has been developed that generates an error-correcting recursive-descent syntax analyzer (parser) with no backtrack from an extended context-free grammar. A program, LLGEN, has been written to implement this algorithm. The paper discusses three aspects of the algorithm: the support of separate compilation, the mechanism for the static or dynamic resolving of conflicts, and the error...
متن کاملUsing the Eclipse C/C++ Development Tooling as a Robust, Fully Functional, Actively Maintained, Open Source C++ Parser
Open Source parsers that support contemporary C/C++, can recover from errors, include a preprocessor, and that are actively maintained, are rare. This work describes how to use the parser contained in the Eclipse C/C++ Development Tooling (CDT) as a Java library. Such parser provides not only the abstract syntax tree of the parsed le but also the semantics, i.e., type information and bindings. ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1992